package com.sjsu.aws.primitive.client.service;

import com.sjsu.aws.primitve.Primitive;
import com.sjsu.aws.primitve.PrimitiveServiceImpl;

public class DeletePrimitiveServices {
	
	public void deleteConfigurationService() throws Exception {
		Primitive pm = new Primitive();
		pm.setServiceName("ConfigurationMgmt");
		PrimitiveServiceImpl primitiveServiceImpl = new PrimitiveServiceImpl();
		primitiveServiceImpl.deleteService(pm);
	}
	
	public void deleteWatchRegisterService() throws Exception {
		Primitive pm = new Primitive();
		pm.setServiceName("WatchRegister");
		PrimitiveServiceImpl primitiveServiceImpl = new PrimitiveServiceImpl();
		primitiveServiceImpl.deleteService(pm);
	}
	
	public void deleteRendezvousService() throws Exception {
		Primitive pm = new Primitive();
		pm.setServiceName("Rendezvous");
		PrimitiveServiceImpl primitiveServiceImpl = new PrimitiveServiceImpl();
		primitiveServiceImpl.deleteService(pm);
	}
	
	public void deleteGroupService() throws Exception {
		Primitive pm = new Primitive();
		pm.setServiceName("Group");
		PrimitiveServiceImpl primitiveServiceImpl = new PrimitiveServiceImpl();
		primitiveServiceImpl.deleteService(pm);
	}
	
	public void deleteDoubleBarrierService() throws Exception {
		Primitive pm = new Primitive();
		pm.setServiceName("DoubleBarrier");
		PrimitiveServiceImpl primitiveServiceImpl = new PrimitiveServiceImpl();
		primitiveServiceImpl.deleteService(pm);
	}
	
	public static void main(String[] args) {
		DeletePrimitiveServices deletePrimitiveServices = new DeletePrimitiveServices();
		
		try {
			deletePrimitiveServices.deleteConfigurationService();
			deletePrimitiveServices.deleteWatchRegisterService();
			deletePrimitiveServices.deleteRendezvousService();
			deletePrimitiveServices.deleteGroupService();
			deletePrimitiveServices.deleteDoubleBarrierService();
		} catch (Exception e) {
			System.out.println("Error in deleting services " + e.getMessage());
			e.printStackTrace();
		}
	}
}
